package cn.zqy.demo2.day12FunctionalInterface.Consumer;

import java.util.function.Consumer;

public class Demo03Test {
    public static void printMsg(String[] strs, Consumer<String> con1, Consumer<String> con2) {
        for (String str : strs) {
            con1.andThen(con2).accept(str);
        }
    }

    public static void main(String[] args) {
        String[] s = new String[]{ "迪丽热巴,65", "古力娜扎,18", "马尔扎哈,985" };
        printMsg(s, (String ss) -> {
            String s1 = ss.split(",")[0];
            System.out.print("姓名：" + s1);
        }, (String ss) -> {
            String s1 = ss.split(",")[1];
            System.out.println("，年龄：" + s1 + "。");
        });
    }
}
